<?php require 'common/header.php';?>
<?php require 'common/left.php';?>
<div id="main-content">
  <h2>欢迎您 <?php echo $_COOKIE['adminname'];?></h2>
  <p id="page-intro">漏洞类型管理。</p>
  <div class="clear"></div>
  <div class="content-box">
    <div class="content-box-header">
      <h3>漏洞类型管理</h3>
      <ul class="content-box-tabs">
      	 <li><a href="<?php echo Qtpl::createUrl('cate', 'index','','admin');?>" class="default-tab">类型管理</a></li>
         <li><a href="<?php echo Qtpl::createUrl('cate', 'show','','admin');?>">添加类型</a></li>
	  </ul>
      <div class="clear"></div>
    </div>
    <div class="content-box-content">
        <div class="tab-content default-tab" id="tab1">
          <table>
            <thead>
              <tr>
				<th>名称</th>
				<th>管理</th>
              </tr>
            </thead>
            <tbody>
            <?php 
            foreach ($_tpl['p'] as $v){
            	echo "<tr><td><b>{$v['cate_name']}</b></td><td><a href='".Qtpl::createUrl('cate', 'show',array('cid'=>$v['cid']),'admin')."'>编辑</a>|<a onclick=\"confirm('你确定要删除此类型吗？')\" href='".Qtpl::createUrl('cate', 'del',array('cid'=>$v['cid'],'token'=>$_tpl['token']),'admin')."'>删除</a></td></tr>";
            	if($_tpl['c'][$v['cid']]){
	            	foreach ($_tpl['c'][$v['cid']] as $vv){
	            		echo "<tr><td>|____{$vv['cate_name']}</td><td>|____<a href='".Qtpl::createUrl('cate', 'show',array('cid'=>$vv['cid']),'admin')."'>编辑</a>|<a onclick=\"return confirm('你确定要删除此类型吗？')\" href='".Qtpl::createUrl('cate', 'del',array('cid'=>$vv['cid'],'token'=>$_tpl['token']),'admin')."'>删除</a></td></tr>";
	            	}
            	}
            }
            ?>
            </tbody>
          </table>
        </div>
      </div>
  </div>
<?php require 'common/footer.php';?>